package com.migu.contacts.bean;

import android.text.TextUtils;

import java.util.List;

public class UserBean {
    public boolean checked;
    public String firstLetter;
    public int id;
    public String realName;
    public String namePinyin;
    public String nickName;
    public String englishName;
    public int gender;
    public String avatar;
    public String lunarBirthday;
    public String birthday;
    public int age;
    public String constellation;
    public String mobile;
    public String telephone;
    public String email;
    public int edu;
    public int maritalStatus;
    public int importance;
    public String note;
    public String common;
    public BirthdayTip birthdayContactsTip;
    public FestivalTip festivalContactsTip;
    public GiftTip giftTip;
    public int addType;
    public boolean birthdayTipStatus;
    public boolean festivalTipStatus;
    public boolean giftTipStatus;
    public boolean cycleTipStatus;
    public Object cycleTipContent;
    public String createTime;
    public List<ContactBean.JobList> jobList;
    public ContactBean.Address homeAddress;
    public ContactBean.Address currentAddress;
    public List<Integer> groupIdList;
    public List<Integer> labelIdList;
    public ContactBean.CycleTip contactsCycleTip;
    public List<DetailBean.ContactInfoList> contactsList;
    public List<ContactsRelationalList> contactsRelationalList;
    public int userType;
    public String memberEndTime;
    public String address;
    public String invitationCode;
    public int messageTip;

    public String getRealName4Show() {
        if (TextUtils.isEmpty(realName)) {
            return "未命名";
        }
        return realName;
    }

    public String getNickName4Show() {
        if (TextUtils.isEmpty(nickName)) {
            return "用户昵称";
        }
        return nickName;
    }

    public String getEnglishName4Show() {
        if (TextUtils.isEmpty(englishName)) {
            return "英文名";
        }
        return englishName;
    }

    public String getIndustryName() {
        if (jobList != null) {
            ContactBean.JobList list = jobList.get(0);
            if (list != null) {
                String industryName = list.industryName;
                if (!TextUtils.isEmpty(industryName)) {
                    return industryName;
                }
            }
        }
        return "暂未填写";
    }

    public String getPositionName() {
        if (jobList != null) {
            ContactBean.JobList list = jobList.get(0);
            if (list != null) {
                String industryName = list.positionName;
                if (!TextUtils.isEmpty(industryName)) {
                    return industryName;
                }
            }
        }
        return "暂未填写";
    }

    public String getEmail4Show() {
        if (!TextUtils.isEmpty(email)) {
            return email;
        }
        return "暂未填写";
    }

    public String getMobile4Show() {
        if (!TextUtils.isEmpty(mobile)) {
            return mobile;
        }
        return "暂未填写";
    }

    public String getCompany() {
        if (jobList != null && jobList.size() > 0) {
            ContactBean.JobList jobList1 = jobList.get(0);
            if (jobList1 != null) {
                String name = jobList1.name;
                if (!TextUtils.isEmpty(name)) {
                    return name;
                }
            }
        }
        return "暂未填写";
    }

    public String getAddress() {
        if (jobList != null && jobList.size() > 0) {
            ContactBean.JobList jobList1 = jobList.get(0);
            if (jobList1 != null) {
                String name = jobList1.address;
                if (!TextUtils.isEmpty(name)) {
                    return name;
                }
            }
        }
        return "暂未填写";
    }

    public static class ContactsRelationalList {
        long contactsId;
        List<Integer> groupIds;

        public ContactsRelationalList(DetailBean.ContactInfoList bean) {
            contactsId = bean.contactId;
            groupIds = bean.groupList;
        }
    }

    public String getSex() {
        if (gender == 1) {
            return "男";
        }
        return "女";
    }

}
